<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function fun1(){
				let reg1=/^[A-z][\w]{2,14}$/;
				let username=document.getElementById("username").value;
				if(reg1.test(username)){
					document.getElementById("res1").innerHTML="OK";
				}else{
					document.getElementById("res1").innerHTML="ERROR";
				}
			}
			function fun2(){
				let reg2=/^[1][\d]{10}$/;
				let moblieN=document.getElementById("moblieN").value;
				if(reg2.test(moblieN)){
					document.getElementById("res2").innerHTML="OK";
				}else{
					document.getElementById("res2").innerHTML="ERROR";
				}
			}
			function fun3(){
				let reg3=/(^0[\d]{2}-?\d{8})|(^0[\d]{3}-?\d{7})$/;
				let phone=document.getElementById("phone").value;
				if(reg3.test(phone)){
					document.getElementById("res3").innerHTML="OK";
				}else{
					document.getElementById("res3").innerHTML="ERROR";
				}
			}
			function fun4(){
				let reg4=/^(([1-9]\d{0,14})|0)(\.\d{1,2})?$/;
				let money=document.getElementById("money").value;
				if(reg4.test(money)){
					document.getElementById("res4").innerHTML="OK";
				}else{
					document.getElementById("res4").innerHTML="ERROR";
				}
			}
		</script>
		
	</head>
	<body>
		输入用户昵称： <input type="text" id="username"> <button type="button" onclick="fun1()">检测</button>
		<span id="res1"></span>
		<br>
		输入手机号码： <input type="text" id="moblieN"> <button type="button" onclick="fun2()">检测</button>
		<span id="res2"></span>
		<br>
		输入座机号码： <input type="text" id="phone"> <button type="button" onclick="fun3()">检测</button>
		<span id="res3"></span>
		<br>
		输入存款金额： <input type="text" id="money"> <button type="button" onclick="fun4()">检测</button>
		<span id="res4"></span>
	</body>
</html>
